<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@taglib prefix="s" uri="/struts-tags" %>
<%@ page import="com.onlineMIS.ORM.entity.chainS.inventoryFlow.ChainInventoryFlowOrder" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>千禧宝贝连锁店管理信息系统</title>
<%@ include file="../../common/Style.jsp"%>
<script>
var dataGrid ;
$(document).ready(function(){
	parent.$.messager.progress('close'); 
	loadResult();
	var orderId = $("#orderId").val();
	dataGrid = $('#dataGrid').datagrid({
			url : 'headqInventoryFlowJSONAction!selectOrderProductDetails',
			queryParams: {
				'formBean.flowOrder.id':orderId
			},
            fitColumns: true,
            fit: true,
            singleSelect: true,
            rowStyler: function(index,row){
    			var style = "";
    			if (row.quantity > 10)
    				style += 'color:red;';
    			return style;
    		},
    		showFooter:true,
    		rownumbers:true,
    		editable: false,
            columns: [[          	
            	{field: 'year', title: '年份', width: 20},
            	{field: 'quarter', title: '季度', width: 20},
            	{field: 'brand', title: '品牌', width: 50},
            	{field: 'categoryLevel', title: '产品线', width: 30},
                {field: 'category', title: '货品类别', width: 50},
            	{field: 'productCode', title: '货号', width: 30},                          
                {field: 'colorName', title: '颜色', width: 30},
                {field: 'barcode', title: '条码', width: 60},
                {field: 'unit', title: '单位', width: 30},                                
                {field: 'quantity', title: '实际数量', width: 20},         
                {field: 'inventoryQ', title: '库存', width: 20},
                {field: 'action1', title: '差额', width: 20,
    				formatter: function (value, row, index){
    					return row.quantity-row.inventoryQ;
    				}},
                {field: 'comment', title: '摘要', width: 40},
                {field: 'action', title: '图片', width: 30,
        			formatter : function(value, row, index) {
        				if(row.id !=0){
	        				var str = '';     				
	        				str += $.formatString('<a href="#" onclick="viewImgP(\'{0}\');"><img border="0" src="{1}" /></a>', row.barcode,'<%=request.getContextPath()%>/conf_files/easyUI/themes/icons/img3.png');        			       				
	        				return str;
        				}
        			}},
        		{field: 'scanNums', title: '扫描次数', width: 20},
            ]]});
});

function downloadOrder(){
    document.headqInventoryFlowForm.action="headqInventoryFlowJSPAction!downloadFlowOrder";
    document.headqInventoryFlowForm.submit();
}

</script>
</head>
<body>
<div class="easyui-layout" data-options="fit : true,border : false">
	<div data-options="region:'north',border:false" style="height: 130px;">
	 <%@ include file="../common/JRComponent.jsp"%>
    <s:form action="/action/headqInventoryFlowJSPAction!editOrder" method="POST" name="headqInventoryFlowForm" id="headqInventoryFlowForm" theme="simple">
	<s:hidden name="formBean.flowOrder.id"/>   
	<input type= "hidden" id="orderId" value='<s:property value="formBean.flowOrder.id"/>'></input>
    <table width="98%" align="center"  class="OuterTable">
	    <tr><td>	         
			 <table width="100%" border="0" >			 
			       <td height="50" colspan="7">
				   	 <table width="100%" border="0">
				   	 <tr class="PBAOuterTableTitale">
				         <td height="32" colspan="5">
				              	<s:property value="formBean.flowOrder.typeHQS"/>:<s:property value="formBean.flowOrder.id"/>
				         </td>
			           </tr>				      
				       <tr class="InnerTableContent">
				      	 <td width="15%" height="32">
							<strong>条码：</strong>
							<s:textfield cssClass="easyui-searchbox" id="barcode" data-options="prompt:'请输入需要查询的条码',searcher:searchBarcode" size="30" />		
						</td>				        
				         <td width="12%"><strong>创建人:&nbsp;   </strong><s:property value="uiBean.flowOrder.creator.name"/></td>
				         <td width="15%"><strong>日期:&nbsp;   </strong><s:property value="uiBean.flowOrder.orderDate"/></td>
				         <td width="45%"><strong>状态: &nbsp;  </strong>
				         	  <s:if test="uiBean.flowOrder.status == 3">
				              		 <font style="color:red"><s:property value="uiBean.flowOrder.statusS"/></font>
				              </s:if><s:else>
				                     <s:property value="uiBean.flowOrder.statusS"/>
				              </s:else>
				         </td>
				         <td>
				         <s:if test="(#session.LOGIN_USER.containFunction('headqInventoryFlowJSPAction!downloadFlowOrder')) ">
				         	<a onclick="downloadOrder();" href="javascript:void(0);" class="easyui-linkbutton c8" style="width:100px; height: 25px;">下载单据</a> 
				         </s:if>
				         </td>
				       </tr>
				       <tr>
				       		 <td height="32"><strong>仓库: &nbsp;  </strong><s:property value="uiBean.storeName"/></td>
				       		<td  ><strong>备注：</strong><s:property value="uiBean.flowOrder.comment"/></td>
				       		<td colspan="5"></td>
				       </tr>
				     </table></td>				
			  </table>
	   </td></tr>
	 </table>
	 </s:form>
	 </div>
	 <div data-options="region:'center',border:false">
			<table id="dataGrid">
			</table>
		</div>
</div>	
</body>
</html>
</body>
</html>